#ifndef LOGR_KEYWORDS_H
#define LOGR_KEYWORDS_H

#include <sys/stat.h>
#include <sys/fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <ctype.h>
#include <sys/time.h>
#include <assert.h>
#include <gr_graph_fun.h>

#define NSEARCHENGINE 20

typedef struct _web_keyword_node {
    char *keyword;
    int tcount;
    int ncount[NSEARCHENGINE];
} WebKeywordStruct;

typedef struct _web_keyword_node *WebKeywordPtr;

WebKeywordPtr
new_web_keyword_node(void);

WebKeywordPtr
new_web_keyword_node2(char *keyword);

void
delete_web_keyword_node(WebKeywordPtr kn);

void
LOGR_set_keyword(WebKeywordPtr kn, char *keyword);
char *
LOGR_get_keyword(WebKeywordPtr kn);

void
LOGR_set_total_count(WebKeywordPtr kn, int n);

void
LOGR_inc_total_count(WebKeywordPtr kn);

int
LOGR_get_total_count(WebKeywordPtr kn);

void
LOGR_set_search_engine_count(WebKeywordPtr kn, int n, int i);

void
LOGR_inc_search_engine_count(WebKeywordPtr kn, int i);

int
LOGR_get_search_engine_count(WebKeywordPtr kn, int i);

int
LOGR_is_total_count_keyword_lower(WebKeywordPtr u, WebKeywordPtr v);

int
LOGR_is_total_count_keyword_bigger(WebKeywordPtr u,WebKeywordPtr v);

int
LOGR_is_se_count1_keyword_lower(WebKeywordPtr u, WebKeywordPtr v);

int
LOGR_is_se_count1_keyword_bigger(WebKeywordPtr u,WebKeywordPtr v);

int
LOGR_is_se_count2_keyword_lower(WebKeywordPtr u, WebKeywordPtr v);

int
LOGR_is_se_count2_keyword_bigger(WebKeywordPtr u,WebKeywordPtr v);

int
LOGR_is_se_count3_keyword_lower(WebKeywordPtr u, WebKeywordPtr v);

int
LOGR_is_se_count3_keyword_bigger(WebKeywordPtr u,WebKeywordPtr v);

int
LOGR_is_se_count4_keyword_lower(WebKeywordPtr u, WebKeywordPtr v);

int
LOGR_is_se_count4_keyword_bigger(WebKeywordPtr u,WebKeywordPtr v);

int
LOGR_is_se_count5_keyword_lower(WebKeywordPtr u, WebKeywordPtr v);

int
LOGR_is_se_count5_keyword_bigger(WebKeywordPtr u,WebKeywordPtr v);

int
LOGR_is_se_count6_keyword_lower(WebKeywordPtr u, WebKeywordPtr v);

int
LOGR_is_se_count6_keyword_bigger(WebKeywordPtr u,WebKeywordPtr v);

int
LOGR_is_se_count7_keyword_lower(WebKeywordPtr u, WebKeywordPtr v);

int
LOGR_is_se_count7_keyword_bigger(WebKeywordPtr u,WebKeywordPtr v);

#endif

